package com.itHuangTao.tank.effects;

import com.almasb.fxgl.core.math.FXGLMath;
import com.almasb.fxgl.dsl.FXGL;
import com.almasb.fxgl.dsl.components.Effect;
import com.almasb.fxgl.entity.Entity;
import com.almasb.fxgl.texture.AnimatedTexture;
import com.almasb.fxgl.texture.AnimationChannel;
import com.almasb.fxgl.texture.Texture;
import com.itHuangTao.tank.Config;
import com.itHuangTao.tank.TankApp;
import com.itHuangTao.tank.TankEntityFactory;
import javafx.scene.layout.StackPane;
import javafx.util.Duration;


public class EnemyAppearanceEffect extends Effect {

    Texture texture = FXGL.texture("tank/E" + FXGLMath.random(1, 12) + "U.png");


    public EnemyAppearanceEffect() {
        super(TankApp.enemyAppearance);
    }

    //效果开始的时候
    @Override
    public void onStart(Entity entity) {
    }

    //效果结束的时候
    @Override
    public void onEnd(Entity entity) {
        TankEntityFactory.at.stop();
        entity.getViewComponent().addChild(texture);
    }

}
